package com.ly.spring.mvc.web;


import javax.servlet.*;
import java.io.IOException;

public class ServletFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {

        //请求到达目标资源之前

        //执行过滤链方法
        chain.doFilter(request, response);

        //请求从目标资源返回，执行的代码
    }

    @Override
    public void destroy() {

    }
}
